/**
 * @name        router-custom.ts
 * @author      shenyc
 * @date        2020-05-06 - ?
 * @copyright   Copy right (c) shenyc (shenyczz@163.com).
 *              All rights reserved.
 *
 ******************************************************************************/
// {{@@@}}
"use strict"
// ----------------------------------------------------------------------------
import { type RouteRecordRaw, createRouter, createWebHistory, createWebHashHistory } from "vue-router"
import { hookProgress } from "@/hooks"
import routers from "./router-all"
// ----------------------------------------------------------------------------
// console.log(`🍍 [router] import.meta.env.BASE_URL = ${import.meta.env.BASE_URL}`);
const { start, done } = hookProgress()
const routerMode = {
    hash: () => createWebHashHistory(),
    history: () => createWebHistory(),
}
// ----------------------------------------------------------------------------
/**
 *
 */
export const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    strict: false, // 尾部斜杠
    sensitive: false, // 大小写敏感
    routes: routers,
    scrollBehavior: (to, from, savedPosition) => {
        if (savedPosition) {
            return savedPosition
        } else {
            return { left: 0, top: 0 }
        }
    },
})

export default router
// ----------------------------------------------------------------------------
// {{@@@}}
